<template>
  <Scroll :height="scrollHgight">
    <div class="title">测试报告</div>
    <div class="right">{{ execute_time | dateFormat() }}</div>
    <TestcaseReport
      v-if="type == 'testcase'"
      :version.sync="version"
    ></TestcaseReport>
    <TestsuiteReport
      v-if="type == 'testsuite'"
      :version.sync="version"
    ></TestsuiteReport>
    <span class="bottom">--- 我是有底线的 ---</span>
  </Scroll>
</template>
<script>
import TestcaseReport from "@/view/components/HttpAutoTestService/report/testcase-report";
import TestsuiteReport from "@/view/components/HttpAutoTestService/report/testsuite-report";
export default {
  name: "report",
  components: {
    TestcaseReport,
    TestsuiteReport,
  },
  created() {
    this.type = this.$route.params.type;
  },
  mounted() {
    this.scrollHgight = document.documentElement.clientHeight;
    this.version = this.$route.params.version;
    this.execute_time = new Date(parseInt(this.version));
  },
  data() {
    return {
      scrollHgight: 300,
      type: "",
      version: "",
      execute_time: "",
    };
  },
};
</script>
<style scoped>
.title {
  display: flex;
  justify-content: center;
  font-family: "PingFang SC";
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 5px;
  color: #464c5b;
}
.right {
  display: flex;
  justify-content: flex-end;
  font-size: 14px;
  font-weight: bold;
  color: #657180;
  margin-right: 10px;
}
.bottom {
  display: flex;
  justify-content: center;
  margin: 5px 0;
  color: #c5c8ce;
}
</style>